﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace CodeSystem.Controllers
{
    public class UserController : Controller
    {
        public ActionResult Login()
        {
            return View();
        }
        [HttpPost]
        public JsonResult Login(string username, string pwd)
        {
            if (username == "CCP" && pwd == "19950409")
            {
                Session["UserName"] = "CCP19950409";
                return Json(new { code = 0 }, JsonRequestBehavior.AllowGet);
            }
            else
                return Json(new { code = 1 }, JsonRequestBehavior.AllowGet);
        }
    }
}